package es.ats.codington.festival.utils;

import es.ats.codington.festival.domain.Event;
import es.ats.codington.festival.domain.EventSignUp;


public class FERSDbQuery {

	private static final FERSJsonReader reader=new FERSJsonReader("prueba.json");

	
	public FERSDbQuery(){
		super();
	}
	
	public static FERSJsonReader getReader() {
		return reader;
	}

	////////////////////////Visitor////////////////////////////////////
	public String getVisitorById(){
		//Llamada a JSON
		return reader.readStringFromStructure("Visitor", "getVisitorById");
	}
	
	public String getListVisitor(){
		return reader.readStringFromStructure("Visitor", "getListVisitor");	
	}
	
	public String getVisitorLogin(){
		return reader.readStringFromStructure("Visitor", "getVisitorLogin");	
	}
	
	public String getVisitorUserName(){
		//Llamada a JSON
		return reader.readStringFromStructure("Visitor", "getVisitorUserName");
	}
	
	public String getVisitorPassword(String Password){
		//Llamada a JSON
		return reader.readStringFromStructure("Visitor", "getVisitorPassword");
	}
	
	public String getValidateVisitor(){
		//Llamada a JSON
		return reader.readStringFromStructure("Visitor", "getVisitorPassword");
	}
	
	public String setInsertVisitor() {
		return reader.readStringFromStructure("Visitor", "setInsertVisitor");
	}
	
	
	
	public String updateVisitorPasswordById(){
		return reader.readStringFromStructure("Visitor", "updateVisitorPasswordById");
	}
		
	// Event
	public String getEventById(){		
		return reader.readStringFromStructure("Event", "getEventById");
	}
	
	public String insertEvent(Event e){		
		return reader.readStringFromStructure("Event", "insertEvent");
	}
	
	public String checkEventSeatsAvailableById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventSeatsAvailableById");
	}
	
    public String checkEventNameById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventNameById");
	}
    
    public String checkEventDescriptionById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventDescriptionById");
	}
    
    public String checkEventStartById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventStartById");
	}
    
    public String checkEventDurationById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventDurationById");
	}
    
    public String checkEventTypeById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventTypeById");
	}
    
    public String checkEventPriceById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventPriceById");
	}
    
    public String checkEventPlaceById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventPlaceById");
	}
    
    public String checkEventPhotoById(int eventId){		
		return reader.readStringFromStructure("Event", "checkEventPhotoById");
	}
	
	public String updateEventNameById() {
		return reader.readStringFromStructure("Event", "updateEventNameById");
	}

	public String updateEventDescriptionById() {
		return reader.readStringFromStructure("Event", "updateEventDescriptionById");
	}

	public String updateEventStartById() {
		return reader.readStringFromStructure("Event", "updateEventStartById");
	}
	
	public String updateEventDurationById() {
		return reader.readStringFromStructure("Event", "updateEventDurationById");
	}
	
	public String updateEventTypeById() {
		return reader.readStringFromStructure("Event", "updateEventTypeById");
	}

	public String updateEventPriceById() {
		return reader.readStringFromStructure("Event", "updateEventPriceById");
	}

	public String updateEventPlaceById() {
		return reader.readStringFromStructure("Event", "updateEventPlaceById");
	}
    
	public String deleteEventById(){		
		return reader.readStringFromStructure("Event", "deleteEventById");
	}
	
	public String getAllEvents(){		
		return reader.readStringFromStructure("Event", "getAllEvents");
	}
	
	public String getEventsByName(){		
		return reader.readStringFromStructure("Event", "getEventsByName");
	}
	
	public String getEventsByDescription(){		
		return reader.readStringFromStructure("Event", "getEventsByDescription");
	}
	
	public String getEventsByNameOrDescription(){		
		return reader.readStringFromStructure("Event", "getEventsByNameOrDescription");
	}
	
	public String getEventsByPlaceId(){		
		return reader.readStringFromStructure("Event", "getEventsByPlaceId");
	}
	
	public String getEventsByPlaceType(){		
		return reader.readStringFromStructure("Event", "getEventsByPlaceType");
	}
	
	public String getEventsByZone(){		
		return reader.readStringFromStructure("Event", "getEventsByZone");
	}

	
	//People
	
	public String setInsertPeople() {
		// TODO Auto-generated method stub
		return reader.readStringFromStructure("People", "setInsertPeople");
	}
	public String updatePeopleFirstNameById(){
		return reader.readStringFromStructure("People", "updatePeopleFirstNameById");
	}
	
	public String updatePeopleLastNameById(){
		return reader.readStringFromStructure("People", "updatePeopleLastNameById");
	}
	
	public String updatePeopleEmailAddressById(){
		return reader.readStringFromStructure("People", "updatePeopleEmailAddressById");
	}
	
	public String updatePeoplePhoneNumberById(){
		return reader.readStringFromStructure("People", "updatePeoplePhoneNumberById");
	}
	
	public String updatePeopleNifById(){
		return reader.readStringFromStructure("People", "updatePeopleNifById");
	}
	
	// Place
	public String getPlaceById(int id){
		return reader.readStringFromStructure("Place", "getPlaceById");
	}
	
	
	// EventSingUp
	public String registerVisitorForNewEvent(EventSignUp esu){		
		return reader.readStringFromStructure("Event SignUp", "registerVisitorForNewEvent");
	}
	
	public String unregisterVisitorForEvent(EventSignUp esu){		
		return reader.readStringFromStructure("Event SignUp", "unregisterVisitorForEvent");
	}
	
	public String updateRestSeatsAvailableEvent(Event esu){
		return reader.readStringFromStructure("Event SignUp", "updateRestSeatsAvailableEvent");
		
	}
	
	public String isRegisteredToEvent(EventSignUp esu){
		return reader.readStringFromStructure("Event SignUp", "isRegisteredToEvent");
		
	}

	/*public String getSearchVisitor() {
		// TODO Auto-generated method stub
		return reader.readStringFromStructure("Visitor", "getSearchVisitor");
	}*/

	
	
	public String viewEventsOfUserDAO(int visitorId){
		return reader.readStringFromStructure("Event SignUp", "viewEventsOfUserDAO");
	}
	
	
	//People
	public String checkPhotoById() {
		// TODO Auto-generated method stub
		return reader.readStringFromStructure("Image", "getPhotoById");
	}

	public String insertPhoto() {
		return reader.readStringFromStructure("Image", "insertPhoto");
	}

	
	
	
}
